#include <stdio.h>
#include <stdlib.h>

#define N (1<<3)
#define N_ITER (1<<16)



int sumaArray3d (int a[N][N][N])
{
    int i, j, k, sum = 0;
    int iter;


    for (iter = 0; iter < N_ITER; iter ++)
    {
       for ( i=0; i < N ; i++ )
       {
          for ( j=0; j < N; j++ )
          {
             for ( k=0; k < N; k++)
             {
                sum += a[k][i][j];
             }
          }
      }
    }
    return sum;
}


int main ()
{
 
  int A[N][N][N];
  int *pA = (int*)A;
  int sum;
  int i;

  for ( i=0; i < N*N*N ; i++, pA++ )
    *pA = i; 
  
  sum = sumaArray3d(A);

  printf ("La suma es:%d\n", sum);

  return 0;
}
